package com.zijidelu.luframework.utils.spring.proxy;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.reflect.MethodSignature;

import java.lang.reflect.Method;

/**
 * 切面工具类。
 *
 * @author ZIJIDELU
 * @date: 2024/4/21 22:24
 */
public class AspectUtil {
    /**
     * 根据切点获取方法
     *
     * @param joinPoint 切点
     * @return 方法
     */
    public static Method getMethod(final JoinPoint joinPoint) {
        return ((MethodSignature) joinPoint.getSignature()).getMethod();
    }

    public static MethodSignature getMethodSignature(final JoinPoint joinPoint) {
        return (MethodSignature) joinPoint.getSignature();
    }
}
